(function() {
	module('AEnigmatesStorage Tests', {
		teardown : function() {
			var keys = $.jStorage.index();
			for ( var i = 0; i < keys.length; i++) {
				var key = keys[i];
				if (key.indexOf('test') === 0) {
					$.jStorage.deleteKey(key);
				}
			}
		}
	});

	test('Setup OK', function() {
		ok(true);
	});

	test('solved', function() {
		var storage = new AEnigmatesStorage("test");
		storage.solved();
		ok(storage.isSolved());
	});

	test('puzzle unlocked', function() {
		var storage = new AEnigmatesStorage("test");
		storage.unlock();
		ok(storage.isUnlocked());
	});

	test('puzzle update solved to unlocked', function() {
		var storage = new AEnigmatesStorage("test");
		storage.solved();
		storage.unlock();
		ok(storage.isUnlocked());
		ok(storage.isSolved());
	});

	test('puzzle not yet discovered', function() {
		var storage = new AEnigmatesStorage("test_unsolved");
		ok(storage.isUndiscovered());
	});

}());